<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <script>
    // 1 call 的应用
    // Array.prototype.getSum = function () {
    //   // this
    // }
    // var arr = [1, 2, 3];
    // arr.getSum();
    // arr.push()
    // arr.splice();


    // getElementsByTagName()
    // 伪数组
    var obj = {
      0: 100,
      1: 10,
      2: 11,
      3: 20,
      length: 4
    };
    // obj['4'] = 30;
    // obj.length ++;

    // console.dir(obj);
    
    Array.prototype.push.call(obj, 30);
    Array.prototype.splice.call(obj, 0, 3);
    console.dir(obj);


    var obj = {
      name: 'zs'
    };

    console.log(obj.toString());
    
    var arr = [5, 9];
    console.log(arr.toString());

    console.log(Object.prototype.toString.call(arr));
  </script>
</body>
</html>